package com.hsy.authorization.di.module;

import com.hsy.authorization.mvp.ui.adapter.AuthorizeUnListAdapter;
import com.jess.arms.di.scope.FragmentScope;

import dagger.Module;
import dagger.Provides;

import com.hsy.authorization.mvp.contract.AuthorizeUnListContract;
import com.hsy.authorization.mvp.model.AuthorizeUnListModel;


@Module
public class AuthorizeUnListModule {
    private AuthorizeUnListContract.View view;

    /**
     * 构建AuthorizeUnListModule时,将View的实现类传进来,这样就可以提供View的实现类给presenter
     *
     * @param view
     */
    public AuthorizeUnListModule(AuthorizeUnListContract.View view) {
        this.view = view;
    }

    @FragmentScope
    @Provides
    AuthorizeUnListContract.View provideAuthorizeUnListView() {
        return this.view;
    }

    @FragmentScope
    @Provides
    AuthorizeUnListContract.Model provideAuthorizeUnListModel(AuthorizeUnListModel model) {
        return model;
    }

    @FragmentScope
    @Provides
    AuthorizeUnListAdapter provideAuthorizeAdapter() {
        return new AuthorizeUnListAdapter();
    }
}